#pragma once

#include "API.h"

namespace snake
{

  enum ECellContents
  {
    CELL_EMPTY,
    CELL_WALL,
    CELL_SNAKE_BODY,
    CELL_SNAKE_HEAD_UP,
    CELL_SNAKE_HEAD_DOWN,
    CELL_SNAKE_HEAD_LEFT,
    CELL_SNAKE_HEAD_RIGHT,
    CELL_FOOD,
    CELL_POO
  };

  /** 
    Interface IBoard - represents rectangular field of cells.
    Each cell can be either free or occupied.
    IMPORTANT: zero y means bottom of the field
  */
  struct SNAKE_API IBoard
  {
    virtual ~IBoard() {}

    /// Returns width of the field
    virtual size_t GetWidth() const = 0;

    /// Returns height of the field
    virtual size_t GetHeight() const = 0;

    /// Tests whether cell is free
    virtual bool IsCellFree(size_t x, size_t y) const = 0;
    
    /// Get cell's contents
    virtual ECellContents GetCell(size_t x, size_t y) const = 0;

    /// Set cell's contents
    virtual void SetCell(size_t x, size_t y, ECellContents contents) = 0;
  };

}